<extend name="Base/common"/>
<block name="header"> {:hook('mobileTopNav',array('title'=>$meta_title))} </block>
<block name="body">
<link href="__CSS__/order.css" rel="stylesheet">
  <div class="order">
    <form action="{:U('add')}" id="Z_checkout_form" method="post">
      <!-- 收货地址 -->
      <h4>收货地址</h4>
      <notempty name="data.default_receiver"> <a href="{:U('Receiver/index/buynow/'.$buynow)}" class="receiver">
        <h5>{$data.default_receiver.name}</h5>
        <p>{$data.default_receiver.area}{$data.default_receiver.address}</p>
        <p>{$data.default_receiver.mobile}</p>
        <i class="icon icon-arrow-right"></i>
        <input type="radio" name="receiver_id" class="hide" value="{$data.default_receiver.id}" checked="checked">
        <input type="hidden" id="receiver_city" data-district="{$data.default_receiver.district}" data-province="{$data.default_receiver.province}" value="{$data.default_receiver.city}" />
        </a>
        <else/>
        <div class="content-padded"> <a href="{:U('Receiver/index')}" class="btn btn-block btn-positive">选择收货地址</a> </div>
      </notempty>
      
      <!-- 付款方式 -->
      <h4>付款方式</h4>
      <ul class="payment" id="Z_payment">
        <if condition="is_weixin()">
          <li class="item selected"> <span class="icon weixin"></span>
            <input type="radio" name="payment_type" value="wechatpay" checked="checked">
            <em class="arrow"></em> </li>
          <li class="item"> <span class="icon alipay"></span>
            <input type="radio" name="payment_type" value="alipaywap">
            <em class="arrow"></em> </li>
          <else/>
          <li class="item selected"> <span class="icon alipay"></span>
            <input type="radio" name="payment_type" value="alipaywap" checked="checked">
            <em class="arrow"></em> </li>
        </if>
      </ul>
      <input type="hidden" name="buynowss" value="2" />
     
      <h4>商品清单 <span class="pr-h4">共 <span class="text-danger">{$order_count['total_quantity']}</span> 件商品</span></h4>
      <div class="items">
        <notempty name="data.items">
          <div class="package">
            <volist name="data.items" id="supp">
              <div class="supplier-box">
                <div class="supplier-title">
                  <gt name="supp.store_id" value="0">{$supp.store_name}
                    <else />
                    <span class="is-self">自营</span></gt>
                </div>

                <volist name="supp.item" id="vo">
                  <div class="item item_{$vo['item_id']}_{$vo['item_code']}">
                    <div class="pic"><img src="__ROOT__{:get_image_thumb($vo['cover_path'], 100, 100)}" width="58" height="58"></div>
                    <div class="name">{$vo['name']}</div>
                    <if condition="$vo['stock'] lt $vo['quantity']"><em class="text-danger">此商品所购买数量大于库存</em></if>
                    <notempty name="vo.spec">
                      <div class="spec">
                        <volist name="vo.spec" id="vl"> <span class="mr-sm">{$vl.key}：{$vl.val}</span> </volist>
                      </div>
                    </notempty>
                    <div class="attr"><span class="text-danger"> &yen;{$vo['price']} &times; {$vo['quantity']}</span> </div>
                  </div>
                </volist>
                <div class="send-items Z_send_supp_{$supp.supplier_id}"></div>
              </div>
              <div class="row">
              <input type="text" placeholder="选填，可以留言给卖家"  name="memo" />
              </div>
            </volist>
          </div>
        </notempty>
      </div>
      <!-- 订单支付信息汇总 -->
      <div class="count">
        <ul>
          <li>商品总价：<span id="Z_total_amount" data-price="{$order_count.total_price}">{$order_count['total_price']} 元</span></li>
          <li>运费：<span id="Z_delivery_fee" data-fee="{$delivery_fee.delivery_fee}">{$delivery_fee.delivery_fee} 元</span></li>
        </ul>
      </div>
      <notempty name='join_id'>
          <input type="hidden"  name="join_id" value="{$join_id}">
        </notempty>
      <input type="hidden" name="item_ids" id="Z_item_ids" value="{$item_ids}">
      <input type="hidden" id="Z_button" value="0">
      <input type="hidden" name="invoice_title" id="invoice_title" >
    </form>
  </div>
</block>

<!-- 底部tab -->
<block name="footer"> 
  <div class="bar bar-tab"> 
    <span class="tab-text"> 应付总额：
      <strong class="text-danger" id="Z_total_price"><em class="yen">&yen;</em> {:sprintf('%.2f', $order_count['total_price'])}</strong> 
    </span> 
    <span class="pull-right cart-checkout" id="submitAddress"> <a href="javascript:;" class="btn btn-negative btn-tab" id="Z_order_submit">提交订单</a> </span> 
  </div>
</block>
<block name="script">
  <style type="text/css">
.zone_out{
    cursor: default;}
.package .zone_out{ 
    position:relative; 
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);          
    filter: grayscale(100%);       
    filter: gray; }
.package .zone_out:before{ 
    content:"无货"; 
    color:#fff; 
    background:rgba(246,55,86,1); 
    width:42px; 
    text-align:center;
    height:30px; 
    line-height:30px; 
    position: absolute; 
    top:25px; 
    right:0px; 
    z-index:999;}
</style>
  <script>
    seajs.use(['orderJoin'], function(order){      
      var total_price = '{$order_count.total_price}';
      <if condition='C("REAL_NAME") eq 1 '>
        order.init(total_price,1);
      <else />
      order.init(total_price);
      </if>
    });
  </script> 
</block>
